package ccm.component.override;

import java.util.Objects;
import java.util.Vector;

public class DefaultComboBoxModel<E> extends javax.swing.DefaultComboBoxModel<E>
{
    public DefaultComboBoxModel()
    {
        super();
    }

    public DefaultComboBoxModel(E[] items)
    {
        super(items);
    }

    public DefaultComboBoxModel(Vector<E> v)
    {
        super(v);
    }

    public void replaceElementAt(E anObject,int index)
    {
        if(index<getSize()&&Objects.equals(getElementAt(index),anObject))
        {
            return;
        }
        if(index<getSize()){removeElementAt(index);}
        for(int i=getSize();i<index;++i){insertElementAt(null,i);}
        insertElementAt(anObject,index);
    }

}
